package concurrent.mycondition.CSmodel;

/**
 * 消费者
 * @author jiajie
 *
 */
public class Consumer implements Runnable{
    private final MiddlewareChannel middlewareChannel;

    public Consumer(MiddlewareChannel middlewareChannel) {

        this.middlewareChannel = middlewareChannel;

    }

    @Override
    public void run() {
        while (true) {
//			System.out.println(Thread.currentThread().getName());
            middlewareChannel.accept();
        }

    }

}